#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START curl
# depends: cross-pkg-config
# depends: openssl1.1

reset_mtime curl curl/configure.ac
mkdir -p build/curl
cd build/curl
../../curl/configure \
	${CONFIGURE_ARGS} \
	--with-openssl \
	--disable-rpath \
	--enable-threaded-resolver \
	--enable-openssl-auto-load-config \
	--with-ca-bundle=$prefix/share/ca-certificates/ca-bundle.crt \
	${AUTOCRAP_KLUDGE}

make -j${JOBS} V=1
make -j${JOBS} install DESTDIR=`pwd`/inst
wipe_la_files `pwd`/inst
rm -rf inst${prefix}/share/man
rsync -avH ./inst/ ${stage}/

# XXX: git does NOT use pkg-config and uses curl-config script
mkdir -p -m 755 "${xtools}${build_prefix}/bin"
cp -a "${stage}${prefix}/bin/curl-config" "${xtools}${build_prefix}/bin/"

cd ../..

# RECIPE END curl
